<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PlanarGC: CutShape Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PlanarGC
   &#160;<span id="projectnumber">1.0.2</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a00016.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">CutShape Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="a00039_source.html">CutShape.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:acff797acf2ec08d0f6518751453cd8e2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2">DTWMode</a> { <br/>
&#160;&#160;<a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2ad1b041cb55ee7a7d902d047638991f94">VERTEX_BASED</a>, 
<br/>
&#160;&#160;<a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2a09903e76363ec9eb25fd4721769b0ac5">EDGE_BASED</a>
<br/>
 }</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a68ad4cd012c38f7d3e12662fce682ee4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#a68ad4cd012c38f7d3e12662fce682ee4">CutShape</a> ()</td></tr>
<tr class="memitem:ad293aca8ed4ee90fad7db6ab83367213"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#ad293aca8ed4ee90fad7db6ab83367213">~CutShape</a> ()</td></tr>
<tr class="memitem:a39a6a0ce3f60a9be1318d267d37a355b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#a39a6a0ce3f60a9be1318d267d37a355b">setDissimilarityMatrix</a> (int n, double *dissimilarity, <a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2">DTWMode</a> mode=<a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2a09903e76363ec9eb25fd4721769b0ac5">EDGE_BASED</a>)</td></tr>
<tr class="memitem:a8759740ccadb605b22d924f2c0c9f450"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#a8759740ccadb605b22d924f2c0c9f450">getMatchingScore</a> ()</td></tr>
<tr class="memitem:a6880ca2298450793d473522c20a7eed3"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::pair&lt; int, <br class="typebreak"/>
int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#a6880ca2298450793d473522c20a7eed3">getMatching</a> ()</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="a00016.html">CutShape</a> provides an interface to the classical DTW-based shape matching between two different shapes. Because a graph cut approach is used, the runtime complexity is almost quadratic instead of being cubic for the naive approach.<br/>
 The only thing that has to be provided by the user is the dissimilarity matrix of any pair of points <code></code>(pt1,pt2) where <code>pt1</code> is a point on the first and <code>pt2</code> is a point on the second shape (see <a class="el" href="a00016.html#a39a6a0ce3f60a9be1318d267d37a355b">setDissimilarityMatrix</a>). Afterwards the dissimilarity between two shapes can be obtained via <a class="el" href="a00016.html#a8759740ccadb605b22d924f2c0c9f450">getMatchingScore</a> and the explicit matching can be extracted via <a class="el" href="a00016.html#a6880ca2298450793d473522c20a7eed3">getMatching</a>. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00004.html#_a0">cutshape.cpp</a>.</dd>
</dl></div><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="acff797acf2ec08d0f6518751453cd8e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2">CutShape::DTWMode</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="acff797acf2ec08d0f6518751453cd8e2ad1b041cb55ee7a7d902d047638991f94"></a>VERTEX_BASED</em>&nbsp;</td><td>
<p>the cost of a matching path is the sum of its vertices' costs </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="acff797acf2ec08d0f6518751453cd8e2a09903e76363ec9eb25fd4721769b0ac5"></a>EDGE_BASED</em>&nbsp;</td><td>
<p>the cost of a matching path is the sum of its edges' costs The cost of every edge is defined as the average cost of its vertices' costs scaled by the length of the edge. This is more consistent than the vertex based interpretation of the dissimilarity matrix. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a68ad4cd012c38f7d3e12662fce682ee4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CutShape::CutShape </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>the constructor sets all fields to 0. </p>

</div>
</div>
<a class="anchor" id="ad293aca8ed4ee90fad7db6ab83367213"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CutShape::~CutShape </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the destructor frees the memory consumed so far. </p>

</div>
</div>
<h2>Member Function Documentation</h2>
<a class="anchor" id="a39a6a0ce3f60a9be1318d267d37a355b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CutShape::setDissimilarityMatrix </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>dissimilarity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2">DTWMode</a>&#160;</td>
          <td class="paramname"><em>mode</em> = <code><a class="el" href="a00016.html#acff797acf2ec08d0f6518751453cd8e2a09903e76363ec9eb25fd4721769b0ac5">EDGE_BASED</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>defines the dissimilarity score between two points on two different shapes.<br/>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>Each shape is discretized by <code>n</code> shape points. </td></tr>
    <tr><td class="paramname">dissimilarity</td><td><code>dissimilarity</code> stores <code>n*n</code> dissimilarity values. The dissimilarity between the point <code>x</code> (starting at 0) of the first shape and the point <code>y</code> (starting at 0) of the second shape, is stored in <code>dissimilarity</code>[x+y*n]. </td></tr>
    <tr><td class="paramname">mode</td><td>see DTWMode </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00004.html#a1">cutshape.cpp</a>.</dd>
</dl>
<p>References <a class="el" href="a00025.html#a5925dae5531f32dce166b70d510b68ad">PlanarEdge::setEdge()</a>, and <a class="el" href="a00027.html#a96f79bc032b6354c1c436eee2e72256b">PlanarVertex::setEdgesCCW()</a>.</p>

</div>
</div>
<a class="anchor" id="a8759740ccadb605b22d924f2c0c9f450"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double CutShape::getMatchingScore </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>returns the dissimilarity between the two shapes. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00004.html#a2">cutshape.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6880ca2298450793d473522c20a7eed3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; std::pair&lt; int, int &gt; &gt; CutShape::getMatching </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>returns the optimal matching between two different shapes.<br/>
 The return value consist of <code>k</code> different pairs with <code>n&lt;k&lt;2n</code>, where the first element of the pair represents a point of the first shape and the second element of the pair represents a point of the second shape. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00004.html#a3">cutshape.cpp</a>.</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr class="footer"/><address style="text-align: right;"><small>
  &copy; 2009 - 2013 by Eno T&ouml;ppe, Frank R. Schmidt
  <br/>
  generated by <a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a>
</small></address>
